using System;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.MSE
{
    public class MseConstants
    {
        public const string MexGet = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get";
        public const string MseOperation = "ProcessMessage";
        public const string WSDLPrefix = "wsdl";
        public const string MSENamespace = "http://services.microsoft.com/MSE";
        #region MSE Context Attributes
        public const string MseContext = "MSERequestContext";
        public const string MseBrokerContext = "MseBrokerContext";
        public const string MseCtxRuntimeReceivedAtTSName = "ReceivedAtMSERuntimeTS";
        public const string MseCtxOriginalAction = "OriginalAction";
        public const string MseCtxEndpointUriName = "EndpointURI";
        public const string MseCtxForwardedToName = "ForwardedToURI";
        public const string MseCtxRouteUri = "RouteUri";
        public const string MseCtxActivityId = "ActivityId";
        public const string MseCtxRequestId = "RequestId";
        #endregion
        public const string OperationExecutionContext = "MseOperationExecutionContext";
        public const string RuntimeConfigXmlName = "MseRuntimeConfiguration";
        public const string MseRuntimeNamespace = "http://microsoft.com/mse/runtime";
        public const string MseEndpointConfig = "MSEEndpointConfiguration";
        public const string CatalogNotificationsHost = "CatalogNotificationsMseRuntimeHost";
        public const string BrokerHost = "BrokerRuntimeHost";
        public const string MSEEnpointID = "MSEEndpointID";
        public const string MSEValidateOnly = "ValidateOnly";
        public const string ValidRequestButEmptyResponse = "The request was valid but the auto response was empty";
        public const string RequestFailedValidation = "<InvalidRequest>The request received did not comply to the XML schema defined for this operation.</InvalidRequest>";
        public const string SOAPNS = "http://www.w3.org/2003/05/soap-envelope";

        public const string Soap12Namespace = "http://www.w3.org/2003/05/soap-envelope";
        public const string Soap11Namespace = "http://schemas.xmlsoap.org/soap/envelope/";

        public const string LocalBrokerPolicyName = "Local_Broker_Policy";
        public const string RemoteBrokerPolicyName = "Broker_Proxy_Policy";
        public const string BrokerHostPolicyName = "Broker_Host_Policy";
        public const string EndpointHostPolicyName = "Endpoint_Host_Policy";


        #region Eventing Constants
        public const string WSENamespaceURI = "http://schemas.xmlsoap.org/ws/2004/08/eventing";
        public const string WSEPushDeliveryModeURI = WSENamespaceURI + "/DeliveryModes/Push";
        public const string MSEEventingFilterDialect = "http://services.microsoft.com/2006-07/ServicePlatform/MSE6/Eventing/EventFilter/";
        public const string MSEEventingNamespaceURI = @"http://services.microsoft.com/2006-07/ServicePlatform/MSE6/Eventing";
        #endregion

        #region Properties - defined as such in case the strings are moved to resources
        public static string ComponentName
        {
            get{return "MSE Runtime";}
        }

        public static string EventLogName 
        {
            get {return @"Microsoft MSE Runtime";}
        }

        public static string MseConfigSectionGroupName
        {
            get{return "Microsoft.MSE";}
        }

        public static string MseRuntimeConfigSectionName
        {
            get { return "Runtime"; }
        }

        public static string MseRegKey
        {
            get{return @"HKEY_LOCAL_MACHINE\Software\Microsoft\MSE";}
        }

        public static string CatalogDefaultUri
        {
            get { return @"net.pipe://{0}/ServiceCatalog/Pipe"; }
        }

        public static string CatalogNotificationsDefaultUri
        {
            get { return @"net.pipe://{0}/MseMessenger/EventingPipe"; }
        }
        #endregion

        #region Tracing
        public const string ThreadTracingString = "\tTime:\t{3}\tThread[{0}]\tMessage:\t{2}\tProcessing:\t{1}";
        #endregion
    }

    public enum ResourceDocuments
    {
        EndpointHostPolicy,
        BrokerHostPolicy,
        LocalBrokerPolicy,
        BrokerProxyPolicy,
        ChannelPolicy
    }
}
